﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ChooseFilter.ascx.cs" Inherits="HCFramework.Product.FilterManage.ChooseFilter" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="True" 
    onitemdatabound="RadComboBox1_ItemDataBound">
    <ItemTemplate>
        <asp:CheckBox ID="CheckBox1" runat="server" />
    </ItemTemplate>
</telerik:RadComboBox>
<asp:Literal ID="litPropertyID" runat="server" Visible="False"></asp:Literal>
<script type="text/javascript">
    $(document).ready(function () {
        var pID = <%="'" + litPropertyID.Text.Replace("-","") + "'" %>;
        $("input[propertyid=" + pID + "]").click(function () {
            var text = "";
            $("input[propertyid=" + pID + "]:checked").each(function(){
                text += $(this).attr("text") + ", ";
            });
            var comboInput = $(<%="'#"+RadComboBox1.ClientID+"'" %> + "_Input");
            comboInput.val(text);
        });

        // first set text
        var text = "";
        $("input[propertyid=" + pID + "]:checked").each(function(){
            text += $(this).attr("text") + ", ";
        });
        var comboInput = $(<%="'#"+RadComboBox1.ClientID+"'" %> + "_Input");
        comboInput.val(text);
    });
</script>
